package com.ZengQi.event.service.impl;

import com.ZengQi.event.dao.CompanyDao;
import com.ZengQi.event.dao.impl.CompanyDaoImpl;
import com.ZengQi.event.entity.Company;
import com.ZengQi.event.service.CompanyService;

import java.util.List;

public class CompanyServiceImpl implements CompanyService {
    private final CompanyDao companyDao=new CompanyDaoImpl();

    @Override
    public List<Company> findListCompany() {
        return companyDao.listCompany();
    }

    @Override
    public boolean saveCompany(Company company) {
        return companyDao.insertCompany(company);
    }

    @Override
    public boolean removeCompany(Company conditionCompany) {
        return companyDao.deleteCompany(conditionCompany);
    }

    @Override
    public boolean modifyCompanyByCompanyName(Company conditionCompany, String oldCompanyName) {
        return companyDao.updateCompanyByCompanyName(conditionCompany,oldCompanyName);
    }
}
